#include "Orientation.hpp"

namespace maploader
{
	std::string Orientation::myOrientation[Orientation::Count] = { "orthogonal", "isometric", "isostaggered" };

	unsigned int Orientation::Load(const pugi::xml_node& node)
	{
		std::string orientation = std::string(node.attribute("orientation").value());
		unsigned int myOrientation = Orientation::Count;
		for (unsigned int i = 0; i < Orientation::Count; i++)
		{
			if (Orientation::myOrientation[i] == orientation)
				myOrientation = i;
		}
		if (myOrientation == Orientation::Count)
			myOrientation = 0;

		return myOrientation;
	}
}